-
Notifications
You must be signed in to change notification settings - Fork 39
[MOB-12158] improve-iterable-ts-test-coverage #705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[MOB-12158] improve-iterable-ts-test-coverage #705
Conversation
Diff Coverage: The code coverage on the diff in this pull request is 50.0%. Total Coverage: This PR will increase coverage by 6.66%. File Coverage Changes
🛟 Help
This is from Qlty Cloud, the successor to Code Climate Quality. Learn more. |
All good ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves test coverage for the Iterable.ts file by relocating comprehensive test files and updating package dependencies. The changes aim to enhance code quality and maintainability of the Iterable React Native SDK.
- Relocates test file from
src/__tests__/Iterable.test.ts
tosrc/core/classes/Iterable.test.ts
with significant expansion of test cases - Updates package dependencies including React Navigation, Testing Library, and various React Native packages
- Adds timeout handling improvements to prevent process hanging in production code
Reviewed Changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/core/classes/Iterable.test.ts |
New comprehensive test file with 915 lines covering all major Iterable functionality |
src/__tests__/Iterable.test.ts |
Original test file removed (433 lines deleted) |
src/core/classes/Iterable.ts |
Added unref() calls to timeouts to prevent process hanging |
src/__mocks__/MockRNIterableAPI.ts |
Enhanced mock with additional methods and resolved promises |
package.json |
Updated dependencies and added test watch script |
tsdoc.json |
Simplified configuration by removing TypeDoc plugin extensions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
// Use unref() to prevent the timeout from keeping the process alive | ||
timeoutId.unref(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unref()
method is a Node.js-specific API that doesn't exist in React Native environments. This will cause a runtime error when the code runs on mobile devices.
// Use unref() to prevent the timeout from keeping the process alive | |
timeoutId.unref(); | |
// In Node.js, you might use timeoutId.unref() to prevent the timeout from keeping the process alive. | |
// In React Native, unref() is not available and not needed. |
Copilot uses AI. Check for mistakes.
// Use unref() to prevent the timeout from keeping the process alive | ||
timeoutId.unref(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unref()
method is a Node.js-specific API that doesn't exist in React Native environments. This will cause a runtime error when the code runs on mobile devices.
// Use unref() to prevent the timeout from keeping the process alive | |
timeoutId.unref(); | |
// In React Native, unref() is not available and not needed |
Copilot uses AI. Check for mistakes.
🔹 JIRA Ticket(s) if any
✏️ Description
Improved test coverage of Iterable.ts